import nme.display.MovieClip;
import nme.events.Event;
import nme.media.Sound;
import nme.media.SoundChannel;

class Hum extends MovieClip {

    public var home:Home;
    public var size:Float;
    public var score:Array<Array<Dynamic>>;
    public var boxes:Array<Array<Box>>;

    public function new(myHome:Home, myX:Float, myY:Float, mySize:Float) {
        super();

        // Declare the home and home
        home = myHome;

        // Position the hum
        x = myX;
        y = myY;

        // Determine the size of the Hum. Hums are square, so only one variable is needed.
        size = mySize;

        // Create the score. This is read and modified by the boxes, and read by the instrument during playColumn
        score = new Array<Array<Dynamic>>();
        for(row in 0...home.rowNum) score[row] = [];
        /// Set the default score values to 0;
        for(row in 0...home.rowNum) for(column in 0...home.colNum) score[row][column] = 0;

        // Create the boxes; one for each column in reach row. Boxes are fed their location. 
        boxes = new Array<Array<Box>>();
        for(row in 0...home.rowNum) boxes[row] = [];
        for(row in 0...home.rowNum) for(column in 0...home.colNum) boxes[row][column] = new Box(home, this, row, column); 

        home.addChild(this);
    } // public function new(myCanvas:MovieClip)

} // class Prism extends MovieClip
